package com.example.common.util;

/**
 * 返回给调用端的结果
 * @author weicong
 * @version 1.0 createTime 2020/2/23 16:22
 */
public class Result<T> {

    /**
     * 返回状态
     */
    private int code;

    /**
     * 消息
     */
    private String msg;

    /**
     * 返回的数据
     */
    private T body;

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(int code, String msg, T body) {
        this.code = code;
        this.msg = msg;
        this.body = body;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }
}
